<script>
mainContent_width = $("#mainContent").width();
/*
 * Chosen.prototype.register_observers 注册相关的各事件
 * 搜索框相关事件：
 	this.search_field.blur(function(evt) {
     _this.input_blur(evt);
   });
   this.search_field.keyup(function(evt) {
     _this.keyup_checker(evt);
   });
   this.search_field.keydown(function(evt) {
     _this.keydown_checker(evt);
   });
   this.search_field.focus(function(evt) {
     _this.input_focus(evt);
   });
 * 修改chosen.jquery.js中的Chosen.prototype.winnow_results函数，实现搜索的定制个性化
 * 可在Chosen.prototype.winnow_results中，增加ajax搜索功能
 * 
 */
//$(".chzn-select").chosen({search_contains:true,width:'200px'});
$(function(){
	$().UItoTop({ easingType: 'easeOutQuart' });
    $('[data-rel="chosen"],[rel="chosen"]').each(function(){
        if($(this).find('option').size() > 20){ // 选项大于20个时，启用ajax搜索
            $(this).ajaxChosen({
              minTermLength: 0,
              afterTypeDelay: 100,
              lookingForMsg: "正在查找",
              type: 'GET',
              jsonTermKey: "txt_filter",
              dataType: 'json'
            }, function (data) {
              var terms = {};   
              $.each(data, function (i, val) {
                terms[i] = val;
              });   
              return terms;
            });
        }
    });
});
if(document.domain.indexOf('135editor.com') > 0) {
    document.domain = '135editor.com';
}
</script>
{{$this->Html->script(array(
	'bootstrap.min.js','bootstrap-affix.js','jquery/jquery.ui.totop.min.js',
	'colorPicker.all.min.js','jqColorPicker.js',
 ))}}

{{$this->Combinator->script(array(
	'swfupload/swfupload.js',
	'swfupload/swfupload.queue.js',
	'swfupload/swfupload.cookies.js',
	'swfupload/fileprogress.js',
	'swfupload/handlers.js'
))}}        
<!-- helper中追加的底部脚本 $this->_View->append('bottomscript',$script);-->
{{$this->fetch('bottomscript')}}

<div class="flash ui-wedget" id="fsUploadProgress" style="position:fixed;width:210px;top:80px;right:30px; z-index: 10000000;"></div>
</body>
</html>